package com.sodimac.v2s.view.components {

    import com.sodimac.util.controls.adgFooter.FooterAdvancedDataGrid;
    
    import flash.display.Graphics;
    
    import mx.controls.Label;
    import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;

    [Style(name="backgroundColor", type="uint", format="Color", inherit="no")]
    
    public class BackgroundCellColorNac extends Label {

    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
	{
	     super.updateDisplayList(unscaledWidth, unscaledHeight);
	 		
	     var g:Graphics = graphics;
	     var grid1:FooterAdvancedDataGrid;
	     var str: String;
	     g.clear();
	     
	     if (data != null)
	     {
	     
		     grid1 = FooterAdvancedDataGrid(AdvancedDataGridListData(listData).owner);
		     if ( grid1.isItemSelected(data) || grid1.isItemHighlighted(data))
		     {
		         return;
		     }     
	
		    str = String(data.glosaProblem);
		    if ( (str.indexOf("Sin Problemas") < 0)  ) 
	         {
		         g.beginFill(0xFF0000);
		         g.drawRect(0, 0, unscaledWidth, unscaledHeight);
		         g.endFill();
		     }
	     }
	     
	}
    }
}
